<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Html5Recorder</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: Html5Recorder</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="module-ChiVoxSDK_html5.html">ChiVoxSDK/html5</a>.</span>Html5Recorder<span class="signature">(options)</span><span class="type-signature"></span></h2>
        
            <div class="class-description">HTML5模式的录音机。<br/><br/>

基于navigator.getUserMedia技术设计开发，用于支持HTML5模式的录音, 同时进行在线评测。</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="Html5Recorder"><span class="type-signature"></span>new Html5Recorder<span class="signature">(options)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    创建一个Html5录音机。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">初始化参数。格式参见：<a href="global.html#Default_ChiVoxRecorder_Options">Default_ChiVoxRecorder_Options</a></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line39">line 39</a>
    </li></ul></dd>
    

    

    

    
</dl>


















    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="record"><span class="type-signature"></span>record<span class="signature">(params)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    开始录音。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>params</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">录音时所需的参数。参数有：
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>duration</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">录音时长，单位：毫秒。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>playDing</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            

            

            <td class="description last">录音前是否播放“ding”。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>serverParams</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">录音参数。详见；<a href="global.html#Default_ChiVoxRecorder_Options">Default_ChiVoxRecorder_Options</a></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onRecordIdGenerated</code></td>
            

            <td class="type">
            
                
<span class="param-type">Callback</span>


            
            </td>

            

            

            <td class="description last">开始录音后生成recordId后的Callback。格式：(code, message) => { var lastRecordID = message.recordId; }</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onStart</code></td>
            

            <td class="type">
            
                
<span class="param-type">Callback</span>


            
            </td>

            

            

            <td class="description last">开始录音后的Callback。格式：() => { }</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onStop</code></td>
            

            <td class="type">
            
                
<span class="param-type">Callback</span>


            
            </td>

            

            

            <td class="description last">录音结束后的Callback。格式：(code, message) => { }</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onInternalScore</code></td>
            

            <td class="type">
            
                
<span class="param-type">Callback</span>


            
            </td>

            

            

            <td class="description last">录音中服务器Push回来的中间评分结果的Callback。格式：(code, message) => { }</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onScore</code></td>
            

            <td class="type">
            
                
<span class="param-type">Callback</span>


            
            </td>

            

            

            <td class="description last">服务器评分结果返回后的Callback。格式：(data) => { }</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onScoreError</code></td>
            

            <td class="type">
            
                
<span class="param-type">Callback</span>


            
            </td>

            

            

            <td class="description last">服务器评分出错返回后的Callback。格式：(code, message) => { }</td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line284">line 284</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="reset"><span class="type-signature"></span>reset<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    重置录音机。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line310">line 310</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="showVolumeBar"><span class="type-signature"></span>showVolumeBar<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    显示波形图。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line316">line 316</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="startReplay"><span class="type-signature"></span>startReplay<span class="signature">(options)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    开始回放最后一次录音。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">回放时所需的参数。参数有：
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>recordId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">要回放的录音recordId。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onStop</code></td>
            

            <td class="type">
            
                
<span class="param-type">callback</span>


            
            </td>

            

            

            <td class="description last">回放完成的Callback，格式：() => {}。</td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line250">line 250</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="stopRecord"><span class="type-signature"></span>stopRecord<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    停止录音
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line227">line 227</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="stopReplay"><span class="type-signature"></span>stopReplay<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    停止回放。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="html5_html5recorder.js.html">html5/html5recorder.js</a>, <a href="html5_html5recorder.js.html#line260">line 260</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-ChiVoxSDK.html">ChiVoxSDK</a></li><li><a href="module-ChiVoxSDK_flash.html">ChiVoxSDK/flash</a></li><li><a href="module-ChiVoxSDK_html5.html">ChiVoxSDK/html5</a></li><li><a href="module-ChiVoxSDK_lib.html">ChiVoxSDK/lib</a></li><li><a href="module-ChiVoxSDK_Paragraph.html">ChiVoxSDK/Paragraph</a></li><li><a href="module-ChiVoxSDK_score.html">ChiVoxSDK/score</a></li></ul><h3>Classes</h3><ul><li><a href="module-ChiVoxSDK_flash.FlashPlayer.html">FlashPlayer</a></li><li><a href="module-ChiVoxSDK_flash.FlashRecorder.html">FlashRecorder</a></li><li><a href="module-ChiVoxSDK_html5.Html5Player.html">Html5Player</a></li><li><a href="module-ChiVoxSDK_html5.Html5Recorder.html">Html5Recorder</a></li><li><a href="module-ChiVoxSDK_html5-VolumeBar.html">VolumeBar</a></li><li><a href="module-ChiVoxSDK_lib-EnScoreMap.html">EnScoreMap</a></li><li><a href="module-ChiVoxSDK_lib-StatusCode.html">StatusCode</a></li><li><a href="module-ChiVoxSDK_Paragraph-Paragraph.html">Paragraph</a></li><li><a href="module-ChiVoxSDK_score-Char.html">Char</a></li><li><a href="module-ChiVoxSDK_score-CnSentScore.html">CnSentScore</a></li><li><a href="module-ChiVoxSDK_score-CnWordScore.html">CnWordScore</a></li><li><a href="module-ChiVoxSDK_score-EnSentRec.html">EnSentRec</a></li><li><a href="module-ChiVoxSDK_score-EnSentScore.html">EnSentScore</a></li><li><a href="module-ChiVoxSDK_score-EnWordScore.html">EnWordScore</a></li><li><a href="module-ChiVoxSDK_score-Phone.html">Phone</a></li><li><a href="module-ChiVoxSDK_score-Word.html">Word</a></li><li><a href="module-ChiVoxSDK-ChiVoxSDK.html">ChiVoxSDK</a></li><li><a href="module-ChiVoxSDK-ControlPanel.html">ControlPanel</a></li><li><a href="module-ChiVoxSDK-Dialog.html">Dialog</a></li><li><a href="module-ChiVoxSDK-PlayerBuilder.html">PlayerBuilder</a></li><li><a href="module-ChiVoxSDK-ProgressBar.html">ProgressBar</a></li><li><a href="module-ChiVoxSDK-RecorderBuilder.html">RecorderBuilder</a></li></ul><h3>Namespaces</h3><ul><li><a href="public.html">public</a></li><li><a href="Utils.html">Utils</a></li></ul><h3>Global</h3><ul><li><a href="global.html#Default_ChiVoxPlayer_Options">Default_ChiVoxPlayer_Options</a></li><li><a href="global.html#Default_ChiVoxRecorder_Options">Default_ChiVoxRecorder_Options</a></li><li><a href="global.html#Default_ChiVoxSDK_Options">Default_ChiVoxSDK_Options</a></li><li><a href="global.html#Default_Paragraph_Options">Default_Paragraph_Options</a></li><li><a href="global.html#get_sig">get_sig</a></li><li><a href="global.html#tts">tts</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 21 2017 16:38:41 GMT+0800 (CST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>